//
//  PersonalInformationDetailViewController.m
//  UcarTest
//
//  Created by 陈曦 on 16/1/20.
//  Copyright © 2016年 chenxi. All rights reserved.
//

#import "PersonalInformationDetailViewController.h"
#import "MainPageViewController.h"
#import "Define.h"
#import "Userinfo.h"
#import "Access_token.h"
#import "NetRequestGroup.h"
#import "AFNetworking.h"
#import "AccountDetailsViewController.h"
#import "RechargeViewController.h"
#import "WithdrawDepositViewController.h"
#import "MyBankCardViewController.h"
#import "ModifyPhoneNumberViewController.h"
#import "ModifyPassWordViewController.h"
#import "ModifyPayPasswordViewController.h"
#import "SetPayPassWordViewController.h"
#import "MBProgressHUD.h"
#import "FeedBackViewController.h"  
#import "HelpViewController.h"


@interface PersonalInformationDetailViewController ()

@property (nonatomic, strong) UIScrollView *backgroundScrollView;//背景

@end

@implementation PersonalInformationDetailViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    //导航条
    self.navigationController.navigationBarHidden = NO;
    UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 200, 44)];
    titleLabel.backgroundColor = [UIColor clearColor];
    titleLabel.textColor = [UIColor whiteColor];
    titleLabel.font = [UIFont boldSystemFontOfSize:18];
    titleLabel.textAlignment = NSTextAlignmentCenter;
    titleLabel.text = @"个人中心";
    self.navigationItem.titleView = titleLabel;
    self.navigationController.navigationBar.barTintColor = mainColor;
    self.view.backgroundColor = backgroundMainColor;
    
    //网络请求
    [self NetworkRequests];
    
    //重定义返回键
    UIButton *back = [UIButton buttonWithType:UIButtonTypeCustom];
    back.frame = CGRectMake(0, 0, 22, 22);
    [back setImage:[UIImage imageNamed:@"iconfont-fanhui-white"] forState:UIControlStateNormal];
    [back addTarget:self action:@selector(backTpMainView) forControlEvents:UIControlEventTouchUpInside];
    UIBarButtonItem *backBar = [[UIBarButtonItem alloc] initWithCustomView:back];
    self.navigationItem.leftBarButtonItem = backBar;
    
    //背景视图
    self.backgroundScrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 64, kScreenWidth, kScreenHeight)];
    self.backgroundScrollView.backgroundColor = backgroundMainColor;
    [self.view addSubview:self.backgroundScrollView];
    self.backgroundScrollView.contentSize = CGSizeMake(kScreenWidth, kScreenHeight * 1.1);


}

#pragma mark 网络请求
- (void) NetworkRequests{
    
    //初始化进度框，置于当前的View当中
    MBProgressHUD *HUD = [[MBProgressHUD alloc] initWithView:self.view];
    [self.view addSubview:HUD];
    HUD.label.text = @"正在加载";
    [HUD showAnimated:YES];//HUD开始

    
    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    //申明返回的结果是json类型
    manager.responseSerializer = [AFJSONResponseSerializer serializer];
    //申明请求的数据是json类型
    manager.requestSerializer = [AFHTTPRequestSerializer serializer];
    //如果报接受类型不一致请替换一致text/html或别的
    manager.responseSerializer.acceptableContentTypes = [NSSet setWithObject:@"text/html"];
    
    //用户访问令牌
    Access_token *useAccess = [Access_token shareInstance];
    
    //上传的参数
    NSDictionary *para = @{
                           @"type" : @"1",
                           @"access_token" : useAccess.access_token
                           };
    //你的接口地址
    NSString *url = [NSString stringWithFormat:@"%@%@", kRealmName,kNetMemberInfo];
    //发送请求
    [manager POST:url parameters:para success:^(AFHTTPRequestOperation *operation, id responseObject) {
        
        NSDictionary *dic = responseObject;
        
        NSDictionary *info = dic[@"info"];
        
        self.is_pay = info[@"is_pay"];//是否设置过密码
        
        self.member_role_b = info[@"member_role_b"];//共享车主
        
        self.member_role_c = info[@"member_role_c"];//共享租客
        
        self.member_str = info[@"member_str"];//会员称呼
        
        self.amount_money = info[@"amount_money"];//总金额
        
        self.surplus_money = info[@"surplus_money"];//余额
        
        self.amount_pledge_money = info[@"amount_pledge_money"];//总押金
        
        self.pledge_money = info[@"pledge_money"];//押金
        
        self.credit_money = info[@"credit_money"];//信用额度
        
        self.freeze_pledge_money = info[@"freeze_pledge_money"];//冻结资金
        
        self.bank_card_count = info[@"bank_card_count"];//绑定银行卡数量
        
        //加载个人信息视图
        [self IndividualAccount];

        
        
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        
        [HUD hideAnimated:YES];
        
        //初始化提示框；
        UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"提示" message:@"没有网络" preferredStyle:  UIAlertControllerStyleAlert];
        
        [alert addAction:[UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
            //点击按钮的响应事件；
        }]];
        
        //弹出提示框；
        [self presentViewController:alert animated:true completion:nil];
        
    }];
    
}
//---------------------------此处以上-----------------------------------------



#pragma mark 加载个人信息视图
- (void)IndividualAccount{
    
    //1.账户信息视图
    UIView *individualAccountInformation = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 111)];
    individualAccountInformation.backgroundColor = [UIColor whiteColor];
    [self.backgroundScrollView addSubview:individualAccountInformation];
    
    //头像视图创建
    self.headPhotoBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    self.headPhotoBtn.frame = CGRectMake(20, 35, 46 * 3.74 / 3.07, kScreenWidthEight);
    [self.headPhotoBtn setImage:[UIImage imageNamed:@"iconfont-touxiang"] forState:UIControlStateNormal];
    [individualAccountInformation addSubview:self.headPhotoBtn];
    
    //账户总额
    UILabel *zhanghuzonge = [[UILabel alloc] initWithFrame:CGRectMake(94, 25, 60, 15)];
    zhanghuzonge.text = @"账户总额";
    zhanghuzonge.textColor = [UIColor colorWithRed:51 / 255.0 green:51 / 255.0 blue:51 / 255.0 alpha:1];
    zhanghuzonge.textAlignment = NSTextAlignmentLeft;
    zhanghuzonge.font = [UIFont systemFontOfSize:15];
    [individualAccountInformation addSubview:zhanghuzonge];
    
    UILabel *zhanghuzongexianshi = [[UILabel alloc] initWithFrame:CGRectMake(174, 25, 100, 15)];//显示
    zhanghuzongexianshi.text = [NSString stringWithFormat:@"¥ %@ 元", self.amount_money];
    zhanghuzongexianshi.textColor = mainColor;
    zhanghuzongexianshi.textAlignment = NSTextAlignmentLeft;
    zhanghuzongexianshi.font = [UIFont systemFontOfSize:15];
    [individualAccountInformation addSubview:zhanghuzongexianshi];
    
    //可用余额
    UILabel *keyongyue = [[UILabel alloc] initWithFrame:CGRectMake(94, 55, 60, 12)];
    keyongyue.textColor = wordColor;
    keyongyue.text = @"可用余额";
    keyongyue.textAlignment = NSTextAlignmentLeft;
    keyongyue.font = [UIFont systemFontOfSize:12];
    [individualAccountInformation addSubview:keyongyue];
    
    UILabel *keyongyuexianshi =[[UILabel alloc] initWithFrame:CGRectMake(174, 55, 100, 12)];
    keyongyuexianshi.textColor = wordColor;
    keyongyuexianshi.text = [NSString stringWithFormat:@"¥ %@ 元", self.surplus_money];
    keyongyuexianshi.textAlignment = NSTextAlignmentLeft;
    keyongyuexianshi.font = [UIFont systemFontOfSize:12];
    [individualAccountInformation addSubview:keyongyuexianshi];
    
    //租车押金
    UILabel *zucheyajin = [[UILabel alloc] initWithFrame:CGRectMake(94, 82, 60, 12)];
    zucheyajin.textColor = wordColor;
    zucheyajin.text = @"租车押金";
    zucheyajin.textAlignment = NSTextAlignmentLeft;
    zucheyajin.font = [UIFont systemFontOfSize:12];
    [individualAccountInformation addSubview:zucheyajin];
    
    UILabel *zucheyajinxianshi = [[UILabel alloc] initWithFrame:CGRectMake(174, 82, 100, 12)];
    zucheyajinxianshi.textColor = wordColor;
    zucheyajinxianshi.text = [NSString stringWithFormat:@"¥ %@ 元", self.amount_pledge_money];
    zucheyajinxianshi.font = [UIFont systemFontOfSize:12];
    [individualAccountInformation addSubview:zucheyajinxianshi];
    
    UIImageView *grayBackIV = [[UIImageView alloc] initWithFrame:CGRectMake(kScreenWidth - 20, 45, 10, 20)];
    grayBackIV.image = [UIImage imageNamed:@"iconfont-fanhui-gary"];
    [individualAccountInformation addSubview:grayBackIV];
    
    //账户明细跳转
    UIButton *accountDetailsBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    accountDetailsBtn.frame = CGRectMake(94, 0, kScreenWidth - 94, 155);
    [accountDetailsBtn addTarget:self action:@selector(accountDetailsPush) forControlEvents:UIControlEventTouchUpInside];
    [individualAccountInformation addSubview:accountDetailsBtn];
    
    
    //2.
    //充值
    self.topUpBtn = [DIYPayButton buttonWithType:UIButtonTypeCustom];
    self.topUpBtn.nameLabel.text = @"充值";
    self.topUpBtn.frame = CGRectMake(0, 112, kScreenWidth / 2 - 1, 43);
    self.topUpBtn.moneyImageView.image = [UIImage imageNamed:@"icon-chongzhi"];
    [self.topUpBtn addTarget:self action:@selector(topUpBtnPush) forControlEvents:UIControlEventTouchUpInside];
    [self.backgroundScrollView addSubview:self.topUpBtn];
    
    //提现
    self.withdrawDepositBtn = [DIYPayButton buttonWithType:UIButtonTypeCustom];
    self.withdrawDepositBtn.nameLabel.text = @"提现";
    self.withdrawDepositBtn.frame = CGRectMake(kScreenWidth / 2, 112, kScreenWidth / 2, 43);
    self.withdrawDepositBtn.moneyImageView.image = [UIImage imageNamed:@"icon-tixian"];
    [self.withdrawDepositBtn addTarget:self action:@selector(withdrawDepositBtnPush) forControlEvents:UIControlEventTouchUpInside];

    [self.backgroundScrollView addSubview:self.withdrawDepositBtn];
    
    UIView *demarcationLine0 = [[UIView alloc] initWithFrame:CGRectMake(0, 154.5, kScreenWidth, 0.5)];//分界线
    demarcationLine0.backgroundColor = lineColor;
    [self.backgroundScrollView addSubview:demarcationLine0];

    
    //3.我的银行卡
    self.myBankCardBtn = [DIYMenuButton buttonWithType:UIButtonTypeCustom];
    self.myBankCardBtn.frame = CGRectMake(0, 175, kScreenWidth, 50);
    self.myBankCardBtn.backgroundColor = [UIColor whiteColor];
    self.myBankCardBtn.nameplateImageView.frame = CGRectMake(kScreenWidthTen / 2, 14, 32, 22);
    self.myBankCardBtn.nameplateImageView.image = [UIImage imageNamed:@"icon－bank－card"];
    self.myBankCardBtn.functionLabel.text = @"我的银行卡";
    [self.myBankCardBtn addTarget:self action:@selector(myBankCardBtnPush) forControlEvents:UIControlEventTouchUpInside];
    [self.backgroundScrollView addSubview:self.myBankCardBtn];
    
    UILabel *numberOfBC = [[UILabel alloc] initWithFrame:CGRectMake(kScreenWidth - 80, 18, 50, 15)];
    numberOfBC.textColor = lineColor;
    numberOfBC.text = [NSString stringWithFormat:@"%@ 张",self.bank_card_count];
    numberOfBC.textAlignment = NSTextAlignmentRight;
    numberOfBC.font = [UIFont systemFontOfSize:15];
    [self.myBankCardBtn addSubview:numberOfBC];
    
    UIImageView *grayBackIV1 = [[UIImageView alloc] initWithFrame:CGRectMake(kScreenWidth - 20, 15, 10, 20)];
    grayBackIV1.image = [UIImage imageNamed:@"iconfont-fanhui-gary"];
    [self.myBankCardBtn addSubview:grayBackIV1];
    
    UIView *demarcationLine1 = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 0.5)];//分界线
    demarcationLine1.backgroundColor = lineColor;
    [self.myBankCardBtn addSubview:demarcationLine1];

    UIView *demarcationLine2 = [[UIView alloc] initWithFrame:CGRectMake(0, 49.5, kScreenWidth, 0.5)];//分界线
    demarcationLine2.backgroundColor = lineColor;
    [self.myBankCardBtn addSubview:demarcationLine2];

    
    //4.修改
    //修改手机号
    self.modifyPhoneNumberBtn = [DIYMenuButton buttonWithType:UIButtonTypeCustom];
    self.modifyPhoneNumberBtn.frame = CGRectMake(0, 235, kScreenWidth, 50);
    self.modifyPhoneNumberBtn.backgroundColor = [UIColor whiteColor];
    self.modifyPhoneNumberBtn.nameplateImageView.frame = CGRectMake(kScreenWidthTen / 2, 11, 18.5, 31);
    self.modifyPhoneNumberBtn.nameplateImageView.image = [UIImage imageNamed:@"iconfont-shouji"];
    self.modifyPhoneNumberBtn.functionLabel.text = @"修改手机号";
    [self.modifyPhoneNumberBtn addTarget:self action:@selector(modifyPhoneNumberBtnPush) forControlEvents:UIControlEventTouchUpInside];
    [self.backgroundScrollView addSubview:self.modifyPhoneNumberBtn];
    
    UIImageView *grayBackIV2 = [[UIImageView alloc] initWithFrame:CGRectMake(kScreenWidth - 20, 15, 10, 20)];
    grayBackIV2.image = [UIImage imageNamed:@"iconfont-fanhui-gary"];
    [self.modifyPhoneNumberBtn addSubview:grayBackIV2];

    UIView *demarcationLine3 = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 0.5)];//分界线
    demarcationLine3.backgroundColor = lineColor;
    [self.modifyPhoneNumberBtn addSubview:demarcationLine3];
    
    UIView *demarcationLine4 = [[UIView alloc] initWithFrame:CGRectMake(10, 49.5, kScreenWidth - 10, 0.5)];//分界线
    demarcationLine4.backgroundColor = lineColor;
    [self.modifyPhoneNumberBtn addSubview:demarcationLine4];

    
    //修改登录密码
    self.modifyLoginPasswordBtn = [DIYMenuButton buttonWithType:UIButtonTypeCustom];
    self.modifyLoginPasswordBtn.frame = CGRectMake(0, 285, kScreenWidth, 50);
    self.modifyLoginPasswordBtn.backgroundColor = [UIColor whiteColor];
    self.modifyLoginPasswordBtn.nameplateImageView.frame = CGRectMake(kScreenWidthTen / 2, 11, 25, 31);
    self.modifyLoginPasswordBtn.nameplateImageView.image = [UIImage imageNamed:@"iconfont-password"];
    self.modifyLoginPasswordBtn.functionLabel.text = @"修改登录密码";
    [self.modifyLoginPasswordBtn addTarget:self action:@selector(modifyLoginPasswordBtnPush) forControlEvents:UIControlEventTouchUpInside];
    [self.backgroundScrollView addSubview:self.modifyLoginPasswordBtn];
    
    UIImageView *grayBackIV3 = [[UIImageView alloc] initWithFrame:CGRectMake(kScreenWidth - 20, 15, 10, 20)];
    grayBackIV3.image = [UIImage imageNamed:@"iconfont-fanhui-gary"];
    [self.modifyLoginPasswordBtn addSubview:grayBackIV3];

    
    //修改支付密码
    self.modifyPayPasswordBtn = [DIYMenuButton buttonWithType:UIButtonTypeCustom];
    self.modifyPayPasswordBtn.backgroundColor = [UIColor whiteColor];
    self.modifyPayPasswordBtn.frame = CGRectMake(0, 335, kScreenWidth, 50);
    self.modifyPayPasswordBtn.nameplateImageView.frame = CGRectMake(kScreenWidthTen / 2, 12, 24, 28);
    self.modifyPayPasswordBtn.nameplateImageView.image = [UIImage imageNamed:@"icon-pay-paw"];
    
    if ([self.is_pay isEqualToString:@"0"]) {
        
        self.modifyPayPasswordBtn.functionLabel.text = @"设置支付密码";
        
    } else if ([self.is_pay isEqualToString:@"1"]) {
        
        self.modifyPayPasswordBtn.functionLabel.text = @"修改支付密码";

    }

    [self.modifyPayPasswordBtn addTarget:self action:@selector(modifyPayPasswordBtnPush) forControlEvents:UIControlEventTouchUpInside];
    [self.backgroundScrollView addSubview:self.modifyPayPasswordBtn];
    
    UIImageView *grayBackIV4 = [[UIImageView alloc] initWithFrame:CGRectMake(kScreenWidth - 20, 15, 10, 20)];
    grayBackIV4.image = [UIImage imageNamed:@"iconfont-fanhui-gary"];
    [self.modifyPayPasswordBtn addSubview:grayBackIV4];

    UIView *demarcationLine5 = [[UIView alloc] initWithFrame:CGRectMake(10, 0, kScreenWidth - 10, 0.5)];//分界线
    demarcationLine5.backgroundColor = lineColor;
    [self.modifyPayPasswordBtn addSubview:demarcationLine5];
    
    UIView *demarcationLine6 = [[UIView alloc] initWithFrame:CGRectMake(0, 49.5, kScreenWidth, 0.5)];//分界线
    demarcationLine6.backgroundColor = lineColor;
    [self.modifyPayPasswordBtn addSubview:demarcationLine6];

    //反馈键
    self.feedbackBtn = [DIYMenuButton buttonWithType:UIButtonTypeCustom];
    self.feedbackBtn.frame = CGRectMake(0, 395, kScreenWidth, 50);
    self.feedbackBtn.backgroundColor = [UIColor whiteColor];
    self.feedbackBtn.nameplateImageView.image = [UIImage imageNamed:@"icon-feedback"];
    self.feedbackBtn.functionLabel.text = @"反馈";
    [self.feedbackBtn addTarget:self action:@selector(feedbackBtnPush) forControlEvents:UIControlEventTouchUpInside];

    [self.backgroundScrollView  addSubview:self.feedbackBtn];
    
    UIImageView *grayBackIV5 = [[UIImageView alloc] initWithFrame:CGRectMake(kScreenWidth - 20, 15, 10, 20)];
    grayBackIV5.image = [UIImage imageNamed:@"iconfont-fanhui-gary"];
    [self.feedbackBtn addSubview:grayBackIV5];

    UIView *demarcationLine7 = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 0.5)];//分界线
    demarcationLine7.backgroundColor = lineColor;
    [self.feedbackBtn addSubview:demarcationLine7];
    
    UIView *demarcationLine8 = [[UIView alloc] initWithFrame:CGRectMake(10, 49.5, kScreenWidth - 10, 0.5)];//分界线
    demarcationLine8.backgroundColor = lineColor;
    [self.feedbackBtn addSubview:demarcationLine8];

    //帮助键
    self.helpBtn = [DIYMenuButton buttonWithType:UIButtonTypeCustom];
    self.helpBtn.frame = CGRectMake(0, 445, kScreenWidth, 50);
    self.helpBtn.backgroundColor = [UIColor whiteColor];
    self.helpBtn.nameplateImageView.image = [UIImage imageNamed:@"icon-help"];
    self.helpBtn.functionLabel.text = @"帮助";
    [self.helpBtn addTarget:self action:@selector(helpBtnPush) forControlEvents:UIControlEventTouchUpInside];

    [self.backgroundScrollView  addSubview:self.helpBtn];
    
    UIImageView *grayBackIV6 = [[UIImageView alloc] initWithFrame:CGRectMake(kScreenWidth - 20, 15, 10, 20)];
    grayBackIV6.image = [UIImage imageNamed:@"iconfont-fanhui-gary"];
    [self.helpBtn addSubview:grayBackIV6];

    UIView *demarcationLine9 = [[UIView alloc] initWithFrame:CGRectMake(0, 49.5, kScreenWidth, 0.5)];//分界线
    demarcationLine9.backgroundColor = lineColor;
    [self.helpBtn addSubview:demarcationLine9];

    //退出登录
    self.quitLoginBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    self.quitLoginBtn.frame = CGRectMake(10, 525, kScreenWidth - 20, 40);
    [self.quitLoginBtn setTitle:@"退出登录" forState:UIControlStateNormal];
    self.quitLoginBtn.layer.cornerRadius = 3;
    self.quitLoginBtn.layer.masksToBounds = YES;
    self.quitLoginBtn.backgroundColor = mainColor;
    [self.quitLoginBtn addTarget:self action:@selector(quitLoginPush) forControlEvents:UIControlEventTouchUpInside];
    [self.backgroundScrollView addSubview:self.quitLoginBtn];
    
    
}

#pragma mark  账户明细跳转
- (void) accountDetailsPush {
    
    AccountDetailsViewController *accountVC = [[AccountDetailsViewController alloc] init];
    [self.navigationController pushViewController:accountVC animated:nil];

}

#pragma mark  充值跳转
- (void) topUpBtnPush {
    
    RechargeViewController *rechargeVC = [[RechargeViewController alloc] init];
    
    [self.navigationController pushViewController:rechargeVC animated:nil];
    
}
#pragma mark  提现跳转
- (void) withdrawDepositBtnPush {
    
    WithdrawDepositViewController *withdrawVC = [[WithdrawDepositViewController alloc] init];
    
    [self.navigationController pushViewController:withdrawVC animated:nil];
    
}
#pragma mark  我的银行卡
- (void) myBankCardBtnPush {
    
    MyBankCardViewController *myBankVC = [[MyBankCardViewController alloc] init];
    
    [self.navigationController pushViewController:myBankVC animated:nil];
    
}
#pragma mark 修改手机号
- (void) modifyPhoneNumberBtnPush {
    
    ModifyPhoneNumberViewController *modifyVC = [[ModifyPhoneNumberViewController alloc] init];
    [self.navigationController pushViewController:modifyVC animated:nil];
    
}

#pragma mark 修改登录密码
- (void) modifyLoginPasswordBtnPush {
    
    ModifyPassWordViewController *modifyPassword = [[ModifyPassWordViewController alloc] init];
    
    [self.navigationController pushViewController:modifyPassword animated:nil] ;
    
    
}
#pragma mark 修改支付密码
- (void) modifyPayPasswordBtnPush {
        
    if ([self.is_pay isEqualToString:@"0"]) {
        
        SetPayPassWordViewController *setPayPassword = [[SetPayPassWordViewController alloc] init];
        
        [self.navigationController pushViewController:setPayPassword animated:nil];

    } else if ([self.is_pay isEqualToString:@"1"]) {
        
        ModifyPayPasswordViewController *modifyPayPassword = [[ModifyPayPasswordViewController alloc] init];
        
        [self.navigationController pushViewController:modifyPayPassword animated:nil];

    }
    
}

#pragma mark 反馈
- (void) feedbackBtnPush {
    
    //初始化提示框；
    UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"提示" message:@"功能建设中,敬请期待" preferredStyle:  UIAlertControllerStyleAlert];
    
    [alert addAction:[UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
        //点击按钮的响应事件；
    }]];
    
    //弹出提示框；
    [self presentViewController:alert animated:true completion:nil];
    
//
//    FeedBackViewController *feedBack = [[FeedBackViewController alloc] init];
//    
//    [self.navigationController pushViewController:feedBack animated:nil];
    
}
#pragma mark 帮助
- (void) helpBtnPush {
    
    
    //初始化提示框；
    UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"提示" message:@"功能建设中,敬请期待" preferredStyle:  UIAlertControllerStyleAlert];
    
    [alert addAction:[UIAlertAction actionWithTitle:@"确定" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
        //点击按钮的响应事件；
    }]];
    
    //弹出提示框；
    [self presentViewController:alert animated:true completion:nil];
    


//    HelpViewController *helpVC = [[HelpViewController alloc] init];
//    
//    [self.navigationController pushViewController:helpVC animated:nil];

}

//退出登录
- (void) quitLoginPush{
    
    //登录单例
    Userinfo *user = [Userinfo shareInstance];
    user.isLogin = NO;
    
    Access_token *useAccess = [Access_token shareInstance];
    useAccess.access_token = nil;
    
    MainPageViewController *mainVC = [[MainPageViewController alloc] init];
    
    [self.navigationController pushViewController:mainVC animated:nil];

}


//返回主页
- (void)backTpMainView{
    
    MainPageViewController *mainVC = [[MainPageViewController alloc] init];
    
    [self.navigationController pushViewController:mainVC animated:nil];
    
    
}

@end
